//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    public class WebPublishObject:IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read(xmlName))
            {
                Id = c.GetUIntegerAsInteger("id");
                DivId = c.GetString("divId");
                SourceObject = c.GetOptionalString("sourceObject");
                DestinationFile = c.GetString("destinationFile");
                Title = c.GetOptionalString("title");
                AutoRepublish = c.GetOptionalBoolean("autoRepublish", false);
            }
        }
        internal const string xmlName = "webPublishObject";

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write(xmlName))
            {
                c.SetUIntegerAsInteger("id", Id);
                c.SetString("divId", DivId);
                c.SetOptionalString("sourceObject", SourceObject);
                c.SetString("destinationFile", DestinationFile);
                c.SetOptionalString("title", Title);
                c.SetOptionalBoolean("autoRepublish", AutoRepublish, false);
            }
        }

        #endregion

        private int _id;

        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }
        private string _divId;

        public string DivId
        {
            get { return _divId; }
            set { _divId = value; }
        }
        private string _sourceObject;

        public string SourceObject
        {
            get { return _sourceObject; }
            set { _sourceObject = value; }
        }
        private string _destinationFile;

        public string DestinationFile
        {
            get { return _destinationFile; }
            set { _destinationFile = value; }
        }
        private string _title;

        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }
        private bool _autoRepublish;

        public bool AutoRepublish
        {
            get { return _autoRepublish; }
            set { _autoRepublish = value; }
        }
	
	
	
	
	
	
    }
}
